-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/add sync #173
Feature/add sync #173
Conversation
River-sh
commented
Jun 3, 2024
- bugfix: fix vpn link and rule leak
- add regular sync raven rules
e7bca45
to
08f10a8
Compare
08f10a8
to
4b482fc
Compare
…tain the current VPN link status, and compare the expected status with the current status for configuration. (Wireguard has the same principle) 2. Add a regular synchronization mechanism
4b482fc
to
1f91e43
Compare
/* | ||
Copyright 2023 The OpenYurt Authors. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package utils | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
func FormatProxyServer(format string, args ...interface{}) string { | ||
s := fmt.Sprintf(format, args...) | ||
return fmt.Sprintf("[Proxy Server]: %s", s) | ||
} | ||
|
||
func FormatProxyClient(format string, args ...interface{}) string { | ||
s := fmt.Sprintf(format, args...) | ||
return fmt.Sprintf("[Proxy Client]: %s", s) | ||
} | ||
|
||
func FormatTunnel(format string, args ...interface{}) string { | ||
s := fmt.Sprintf(format, args...) | ||
return fmt.Sprintf("[Tunnel Agent]: %s", s) | ||
} | ||
|
||
func FormatRavenEngine(format string, args ...interface{}) string { | ||
s := fmt.Sprintf(format, args...) | ||
return fmt.Sprintf("[Raven Engine]: %s", s) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was the format method removed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not seem to be necessary, some lib logs do not have this mark
time.Sleep(time.Second) | ||
err = vx.ipset.Flush() | ||
if err != nil { | ||
errList = errList.Append(fmt.Errorf("error flushing ipset: %s", err)) | ||
} | ||
time.Sleep(time.Second) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is necessary, using the tool quickly may cause the tool to return an unnecessary error message when it is busy.
@@ -0,0 +1,129 @@ | |||
/* | |||
Copyright 2023 The OpenYurt Authors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2024
err = vpndriveripset.CleanupRavenSkipNATIPSet() | ||
if err != nil { | ||
errList = errList.Append(fmt.Errorf("error cleanup ipset %s, %s", vpndriveripset.RavenSkipNatSet, err.Error())) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to check here whether the node is a Gateway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When cleaning is needed, it is impossible to determine whether it is a gateway